Imports System
Imports System.Collections.Generic
Imports System.Text
Imports Microsoft.SharePoint

Class ActivateCountdownWebPartFeature
    Inherits SPFeatureReceiver
    Public Overloads Overrides Sub FeatureActivated(ByVal properties As SPFeatureReceiverProperties)

        Using _web As SPWeb = properties.Feature.Parent

            'the image library template
            _web.Features.Add(New Guid("507de1ee-44e8-4c3a-857e-a45b574b4413"))

            'the image library instance
            _web.Features.Add(New Guid("eb155f74-e2ca-4907-9ee2-885fc10ea6b1"))

            'add images to the library
            _web.Features.Add(New Guid("7e50ba41-2843-4669-af26-72f30276e58b"))


            Using _site As SPSite = _web.Site
                'adds webpart to the web part library
                _web.Features.Add(New Guid("55663e0e-7e95-48da-a17b-dcee44babfa3"))
            End Using

        End Using

    End Sub

    Public Overloads Overrides Sub FeatureDeactivating(ByVal properties As SPFeatureReceiverProperties)
        Using _web As SPWeb = properties.Feature.Parent

            'the image library template
            _web.Features.Remove(New Guid("507de1ee-44e8-4c3a-857e-a45b574b4413"))

            'the image library instance
            _web.Features.Remove(New Guid("eb155f74-e2ca-4907-9ee2-885fc10ea6b1"))

            'add images to the library
            _web.Features.Remove(New Guid("7e50ba41-2843-4669-af26-72f30276e58b"))


            Using _site As SPSite = _web.Site
                'adds webpart to the web part library
                _web.Features.Remove(New Guid("55663e0e-7e95-48da-a17b-dcee44babfa3"))
            End Using

        End Using

    End Sub

    Public Overloads Overrides Sub FeatureInstalled(ByVal properties As SPFeatureReceiverProperties)
        'Throw New Exception("The method or operation is not implemented.")
    End Sub

    Public Overloads Overrides Sub FeatureUninstalling(ByVal properties As SPFeatureReceiverProperties)
        'Throw New Exception("The method or operation is not implemented.")
    End Sub
End Class

